package com.yonyou.cyxdms.sysAuth.service.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyxdms.framework.bean.entity.base.DMSBasePO;

import java.io.Serializable;

/**
 * <p>
 * 职位与角色关系
 * </p>
 *
 * @author quankk
 * @since 2019-07-05
 */
@TableName("tr_org_role")
public class OrgPositionRolePO extends DMSBasePO<OrgPositionRolePO> {

    private static final long serialVersionUID = 1L;

    /**
     * 职位ID
     */
    @TableField("ORG_ROLE_ID")
    private Integer orgRoleId;
    /**
     * 角色ID
     */
    @TableField("ROLE_ID")
    private Integer roleId;


    public OrgPositionRolePO() {
        super();
    }

    public Integer getOrgRoleId() {
        return orgRoleId;
    }

    public void setOrgRoleId(Integer orgRoleId) {
        this.orgRoleId = orgRoleId;
    }

    public Integer getRoleId() {
        return roleId;
    }

    public void setRoleId(Integer roleId) {
        this.roleId = roleId;
    }


    @Override
    protected Serializable pkVal() {
        return this.orgRoleId;
    }

    @Override
    public String toString() {
        return "OrgPositionRolePO{" +
                "orgRoleId=" + orgRoleId +
                ", roleId=" + roleId +
                '}';
    }


    /**
     * 将PO 信息转化为DTO
     *
     * @param dto 需要进行转换的dto
     * @author quankk
     * @since 2018/7/22 0022
     */
    protected <T extends BaseDTO> void transDtoToPo(T dto) {
        BeanMapperUtil.copyProperties(this, dto, "positionId");
    }


}
